﻿<Panels:ClosableControl x:Class="MediaBrowser.Gui.Views.UserCtrlAdminMovies"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:ViewModel="clr-namespace:MediaBrowser.Gui.ViewModels"
    xmlns:Panels="clr-namespace:MediaBrowser.CustomControls.Panels;assembly=MediaBrowser.CustomControls"
    xmlns:Converters="clr-namespace:MediaBrowser.Gui.Converters"
    xmlns:julmar="http://www.julmar.com/wpfhelpers"
    xmlns:MediaBrowser_Controls="clr-namespace:MediaBrowser.CustomControls;assembly=MediaBrowser.CustomControls"
    mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="550">

    <Panels:ClosableControl.Resources>
        <Converters:StringToDragBitmapConverter x:Key="stringToDragBitmapConverter" />
		<ViewModel:ViewModelLocator x:Key="Locator" d:IsDataSource="True"/>
    </Panels:ClosableControl.Resources>

    <Grid DataContext="{Binding Movies, Mode=OneWay, Source={StaticResource Locator}}">
        <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" Width="Auto" BorderThickness="3,3,3,3" 
                CornerRadius="4,4,4,4" Background="{DynamicResource BckWindow}">

            <Grid >
                <Grid.RowDefinitions>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>
                <Border Grid.Row="0" BorderThickness="1,1,1,0" CornerRadius="2,2,0,0"  Background="{DynamicResource BackGrdCustom}">
                    <Grid>
                        <Label Margin="5,0,0,0" VerticalAlignment="Center" Foreground="White" Content="Fiche du Film"/>
                        <Image x:Name="imageCross" Width="10" Height="10" Grid.Row="0" HorizontalAlignment="Right" Source="/MediaBrowser.Gui;Component/Images/cross2.png" PreviewMouseDown="Close_Event" RenderTransformOrigin="0.5,0.5" Margin="0,0,5,0" >
                            <Image.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform/>
                                    <SkewTransform/>
                                    <RotateTransform/>
                                    <TranslateTransform/>
                                </TransformGroup>
                            </Image.RenderTransform>
                        </Image>
                    </Grid>
                </Border>
                <Grid Grid.Row="1" Margin="5,15,5,5">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="20"/>
                        <RowDefinition Height="5" />
                        <RowDefinition Height="200" />
                        <RowDefinition Height="5" />
                        <RowDefinition Height="20" />
                        <RowDefinition Height="5" />
                        <RowDefinition Height="210" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100"/>
                        <ColumnDefinition Width="350"/>
                    </Grid.ColumnDefinitions>

                    <Label Grid.Column="0" Grid.Row="0"  Content="Nom : "/>
                    <Label Grid.Column="0" Grid.Row="2"  Content="Description : "/>
                    <Label Grid.Column="0" Grid.Row="4"  Content="Fichier Video : "/>
                    <Label Grid.Column="0" Grid.Row="6"  Content="Affiche : "/>

                    <TextBox x:Name="name" Grid.Column="1" Grid.Row="0" Width="200" HorizontalAlignment="Left" 
                             Text="{Binding NewMedia.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}">
                    </TextBox>
                    <TextBox Grid.Column="1" Grid.Row="2" TextWrapping="Wrap"  
		                             VerticalScrollBarVisibility="Visible" AcceptsReturn="True" 
                                    Text="{Binding NewMedia.Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}">
                        <TextBox.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFD1D4D6" Offset="0"/>
                                <GradientStop Color="White" Offset="0.803"/>
                                <GradientStop Color="White" Offset="1"/>
                            </LinearGradientBrush>
                        </TextBox.Background>
                    </TextBox>
                    <StackPanel Grid.Column="1" Grid.Row="4" Orientation="Horizontal">
                        <TextBox x:Name="UrlContent" Width="250" HorizontalAlignment="Left" Text="{Binding NewMedia.UrlContent, Mode=TwoWay}"/>
                        <MediaBrowser_Controls:ImageButton Command="{Binding ExploreFileCommand}" Width="20" Height="20" Source="/MediaBrowser.Gui;Component/Images/Movie.png" Margin="5,0,0,0" ToolTip="Ouvrir"/>
                        <MediaBrowser_Controls:ImageButton Command="{Binding ClearFileCommand}"  Width="20" Height="20" Source="/MediaBrowser.Gui;Component/Images/cross.png" Margin="5,0,0,0" ToolTip="Supprimer"/>
                    </StackPanel>
                    <Border HorizontalAlignment="Left" BorderThickness="1,1,1,1" CornerRadius="4,4,4,4" Grid.Column="1" Grid.Row="6" Width="220" Height="200">
                        <Border.BorderBrush>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="Black" Offset="0"/>
                                <GradientStop Color="White" Offset="1"/>
                            </LinearGradientBrush>
                        </Border.BorderBrush>
                        <Image Stretch="Fill" AllowDrop="True" Margin="1,1,1,1" 
        							Source="{Binding NewMedia.UrlImage, Converter={StaticResource stringToDragBitmapConverter}, ValidatesOnDataErrors=True}" >
                            <julmar:EventCommander.Mappings>
                                <julmar:CommandEvent Command="{Binding DropPictureCommand}" Event="Drop" CommandParameter="{Binding}" />
                            </julmar:EventCommander.Mappings>
                        </Image>
                    </Border>
                </Grid>
                <StackPanel Orientation="Horizontal" Grid.Row="2" Margin="0" HorizontalAlignment="Right" VerticalAlignment="Top">
                    <Button x:Name="BtSave" IsEnabled="{Binding CanSave}" Command="{Binding SaveMovieCommand}" ToolTip="{Binding StatusCanSave}"  
                            Height="23" Width="95" HorizontalContentAlignment="Stretch" PreviewMouseDown="Close_Event" Margin="0,0,5,0">
                        <Grid>
                            <Image Source="/MediaBrowser.Gui;Component/Images/film_save.png" Width="16" Height="16" HorizontalAlignment="Left" Margin="5,0,0,0"/>
                            <Label Content="Sauvegarder" Margin="15,0,0,0" HorizontalAlignment="Center"/>
                        </Grid>
                    </Button>
                    <Button Height="23" Width="70" HorizontalContentAlignment="Stretch" PreviewMouseDown="Close_Event" Margin="0,0,5,0">
                        <Grid>
                            <Image Source="/MediaBrowser.Gui;Component/Images/cross.png" Width="16" Height="16" HorizontalAlignment="Left" Margin="5,0,0,0"/>
                            <Label Content="Annuler" Margin="15,0,0,0" HorizontalAlignment="Center"/>
                        </Grid>
                    </Button>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</Panels:ClosableControl>
